<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../css/answerCardPublic.css">
    <script src="../js/public.js"></script>
</head>
<!--<link rel="stylesheet" type="text/css" href="../css/answerCardPublic.css" />-->
<!--<link rel="stylesheet" type="text/css" href="../css/index.css" />-->

<body>

<div class="answer-main">
    <ul>
        <li>
            大标题：<span class="fl-r error-msg fc-r" id="erroeMsg"></span>
            <input id="title" type="text" class="handline-inp" placeholder="2018-2019学年度第一学期期中考试">
        </li>
        <li class="children-other">
            <div>
                <span><span class="fc-r">*</span>总字数:</span><input type="text" value="5" id="total"
                                                                   placeholder="例：五、语文作文（60分）">
            </div>
        </li>
    </ul>
</div>
<div class="btn-box">
    <input class="save" type="button" value="保存" id="save">
    <input class="cancel" type="button" value="取消" id="cancel">
</div>
</body>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

<script type="text/javascript">
    var index = parent.layer.getFrameIndex(window.name)
    $('.save').on('click', function () {
        var erroeMsg = document.getElementById("erroeMsg")
        var paramObj = {
            title: getnodeval.getText("title"),
            totla: getnodeval.getNum("total"),
            rowNum: 170 / 10 - 1,
            childrenForEach: false,
            topictype: 'composition',
            editor: false
        }
        if (!paramObj.totla) {
            erroeMsg.innerHTML = "请检查参数是否完整或为对应类型"
            return
        } else {
            erroeMsg.innerHTML = ""
        }
        parent.$('#answerArea').append(createTopicCard(paramObj));
        parent.layer.close(index);
    })
    $('#cancel').on('click', function () {
        parent.layer.close(index);
    })
</script>

</html>